package com.aishua.fire.activiti;

import java.util.Map;

import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.beans.factory.annotation.Autowired;


public abstract class BaseHandlerTask implements TaskListener {

	@Autowired
	private TaskService taskService;
	
	
	/**
	 * 完成任務
	 */
	private static final long serialVersionUID = 1L;

	public abstract Object doSomething(Object reqObj);
	
	public void finishTaskNode(String taskId,Map<String,Object> variables,String user_id) {
		
		taskService.claim(taskId, String.valueOf(user_id));
		if(variables == null) {
			taskService.complete(taskId);
		}else {
			taskService.complete(taskId, variables);
		}
	}
	
	
}
